# 6e8d0695eda80a8cceb90a1d1f152e4d
import requests

KEY = '4r9bergjetiv1tsd'  # API key
UID = "U785B76FC9"  # 用户ID

LOCATION = 'beijing'  # 所查询的位置，可以使用城市拼音、v3 ID、经纬度等
API = 'https://api.seniverse.com/v3/weather/now.json'  # API URL，可替换为其他 URL
UNIT = 'c'  # 单位
LANGUAGE = 'zh-Hans'  # 查询结果的返回语言

def fetchWeather(location):
    result = requests.get(API, params={
        'key': KEY,
        'location': location,
        'language': LANGUAGE,
        'unit': UNIT
    }, timeout=1)
    return result.text


def get_weather(city_name:str):
    url = "https://restapi.amap.com/v3/weather/weatherInfo?"
    params = {"key":"6e8d0695eda80a8cceb90a1d1f152e4d","city":"340100","extensions":"all"}
    city_code = "110000"
    response = requests.get(url=url,params=params)
    return response.json().get("forecasts")

print(fetchWeather(""))
